Fix std::string assignment ambiguity from braced initializer lists. When support for `basic_string_view` was added to string it also added new assignment operators from `basic_string_view`. These caused ambiguity when assigning from a braced initializer. This patch fixes that regression by making the basic_string_view assignment operator rank lower in overload resolution by making it a template. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292276 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/string b/include/string index 136a5fb..7d7994e 100644 --- a/include/string +++ b/include/string
@@ -818,6 +818,7 @@ operator __self_view() const _NOEXCEPT { return __self_view(data(), size()); } basic_string& operator=(const basic_string& __str); + template <class = void> _LIBCPP_INLINE_VISIBILITY basic_string& operator=(__self_view __sv) {return assign(__sv);} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES